import Vue from 'vue'
import Router from 'vue-router'
import Home from './pages/home/Home'
import City from './pages/city/City'
import Detail from './pages/detail/Detail'



Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      component: Home
    },{
      path: '/city',
      component: City
    },
    {
      path: '/detail/:id',
      component: Detail
    },
  ],
  // 打开router官网查看滚动行为可以发现这一串代码，用来解决多页面滚动互相影响的问题
  scrollBehavior () {
    return { x: 0, y: 0 }
  }
})
